{
 "cells": [
  {
   "cell_type": "markdown",
   "id": "f340b26a",
   "metadata": {},
   "source": [
    "## 作业：\n",
    ">1. 尝试搜索POI2.0 接口\n",
    ">2. 获取中餐厅、西餐厅、快餐厅的信息(图片、内容等)"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "e3ab058d",
   "metadata": {},
   "source": [
    "### 假设范围在广州市正佳广场附近"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 113,
   "id": "c473e2ae",
   "metadata": {},
   "outputs": [],
   "source": [
    "import requests\n",
    "geo_url = \"https://restapi.amap.com/v3/geocode/geo?parameters\"\n",
    "payload = {\n",
    "    \"key\":\"6e67697ed04482820bb0560416dca1d7\",\n",
    "    \"address\":\"广东省广州市天河区正佳广场\"\n",
    "}\n",
    "r = requests.get(url=geo_url,params=payload)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 114,
   "id": "c6af67be",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "'113.327030,23.132175'"
      ]
     },
     "execution_count": 114,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "r.json()\n",
    "正佳广场_location = r.json()['geocodes'][0]['location']\n",
    "正佳广场_location "
   ]
  },
  {
   "cell_type": "markdown",
   "id": "2ec7eff6",
   "metadata": {},
   "source": [
    "### 调用pois 2.0的“around”周边搜索"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 159,
   "id": "2a4c2e3e",
   "metadata": {},
   "outputs": [],
   "source": [
    "# 调用requests模块(google chrome 浏览器)\n",
    "import requests\n",
    "\n",
    "# 2.请求方式：get\n",
    "\n",
    "# 3.URL地址\n",
    "around_url = \"https://restapi.amap.com/v5/place/around?parameters\"\n",
    "\n",
    "# 4.准备参数，用于交换数据payload\n",
    "payload = {\n",
    "    \"key\":\"6e67697ed04482820bb0560416dca1d7\",\n",
    "    \"location\":正佳广场_location ,\n",
    "    \"types\":\"中餐厅|西餐厅|快餐厅\",\n",
    "     \"show_fields\":\"photos,business,\"\n",
    "  \n",
    "}\n",
    "\n",
    "# 5.发起请求\n",
    "r = requests.get(url=around_url,params=payload)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 139,
   "id": "b6cf66a2",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "<Response [200]>"
      ]
     },
     "execution_count": 139,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "r"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 160,
   "id": "4d2e8ca5",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "{'status': '1',\n",
       " 'info': 'OK',\n",
       " 'infocode': '10000',\n",
       " 'pois': [{'name': '膳老头猪肚鸡(正佳广场店)',\n",
       "   'id': 'B0G1X9GFSA',\n",
       "   'location': '113.327030,23.132175',\n",
       "   'type': '餐饮服务;中餐厅;中餐厅',\n",
       "   'typecode': '050100',\n",
       "   'pname': '广东省',\n",
       "   'cityname': '广州市',\n",
       "   'adname': '天河区',\n",
       "   'address': '天河路228号正佳广场F5(体育中心地铁站出入口旁)',\n",
       "   'pcode': '440000',\n",
       "   'citycode': '020',\n",
       "   'adcode': '440106',\n",
       "   'business': {'rectag': '客家菜',\n",
       "    'keytag': '客家菜',\n",
       "    'rating': '3.6',\n",
       "    'cost': '95.00'},\n",
       "   'indoor': {'indoor_map': '0'}},\n",
       "  {'name': '小炒一碟(正佳广场店)',\n",
       "   'id': 'B0FFL77QA5',\n",
       "   'location': '113.327030,23.132176',\n",
       "   'type': '餐饮服务;中餐厅;中餐厅',\n",
       "   'typecode': '050100',\n",
       "   'pname': '广东省',\n",
       "   'cityname': '广州市',\n",
       "   'adname': '天河区',\n",
       "   'address': '天河路228号正佳广场M层D53号',\n",
       "   'pcode': '440000',\n",
       "   'citycode': '020',\n",
       "   'adcode': '440106',\n",
       "   'business': {'tel': '18902207247',\n",
       "    'rectag': '中餐',\n",
       "    'keytag': '中餐',\n",
       "    'rating': '3.9',\n",
       "    'cost': '19.00'},\n",
       "   'indoor': {'indoor_map': '0'},\n",
       "   'photos': [{'title': '',\n",
       "     'url': 'https://img.alicdn.com/imgextra/i2/3695320962/O1CN01eRakkg1IydiFeh6U9_!!3695320962-0-kbcontentapng.jpg'}]},\n",
       "  {'name': 'GABU尕布·新疆米粉',\n",
       "   'id': 'B0HD2YAUVU',\n",
       "   'location': '113.327031,23.132177',\n",
       "   'type': '餐饮服务;中餐厅;清真菜馆',\n",
       "   'typecode': '050121',\n",
       "   'pname': '广东省',\n",
       "   'cityname': '广州市',\n",
       "   'adname': '天河区',\n",
       "   'address': '正佳广场M层',\n",
       "   'pcode': '440000',\n",
       "   'citycode': '020',\n",
       "   'adcode': '440106',\n",
       "   'business': {'tel': '13076792612',\n",
       "    'rectag': '米粉',\n",
       "    'keytag': '米粉',\n",
       "    'rating': '4.2'},\n",
       "   'indoor': {'indoor_map': '0'},\n",
       "   'photos': [{'title': '',\n",
       "     'url': 'http://store.is.autonavi.com/showpic/0aecd06734f98f3042127bb1d3da9fb6'},\n",
       "    {'title': '',\n",
       "     'url': 'http://store.is.autonavi.com/showpic/25b2521eed0de07ebc716e6eb57584a0'},\n",
       "    {'title': '',\n",
       "     'url': 'http://store.is.autonavi.com/showpic/87a24212409c2af8954e489597d21352'}]},\n",
       "  {'name': '鱼二郎(正佳广场店)',\n",
       "   'id': 'B0FFK04CFG',\n",
       "   'location': '113.327021,23.132172',\n",
       "   'type': '餐饮服务;中餐厅;中餐厅',\n",
       "   'typecode': '050100',\n",
       "   'pname': '广东省',\n",
       "   'cityname': '广州市',\n",
       "   'adname': '天河区',\n",
       "   'address': '天河路228号正佳广场B1层001-002号',\n",
       "   'pcode': '440000',\n",
       "   'citycode': '020',\n",
       "   'adcode': '440106',\n",
       "   'business': {'tel': '020-89817736',\n",
       "    'rectag': '中餐',\n",
       "    'keytag': '中餐',\n",
       "    'cost': '50.00'},\n",
       "   'indoor': {'indoor_map': '0'},\n",
       "   'photos': [{'title': '',\n",
       "     'url': 'http://store.is.autonavi.com/showpic/d250e90c5b02e93f2b3c312f7a779d43'},\n",
       "    {'title': '',\n",
       "     'url': 'http://store.is.autonavi.com/showpic/00164e907e344dd0aa41b96cce6f32be'},\n",
       "    {'title': '',\n",
       "     'url': 'http://store.is.autonavi.com/showpic/01805abab8327f0be480d3043d74825e'}]},\n",
       "  {'name': '霸蛮湖南米粉',\n",
       "   'id': 'B0IAM5LO8Q',\n",
       "   'location': '113.327019,23.132145',\n",
       "   'type': '餐饮服务;中餐厅;中餐厅',\n",
       "   'typecode': '050100',\n",
       "   'pname': '广东省',\n",
       "   'cityname': '广州市',\n",
       "   'adname': '天河区',\n",
       "   'address': '正佳广场负一楼BF-20-21',\n",
       "   'pcode': '440000',\n",
       "   'citycode': '020',\n",
       "   'adcode': '440106',\n",
       "   'business': {'rectag': '米粉', 'keytag': '米粉'},\n",
       "   'indoor': {'indoor_map': '0'}},\n",
       "  {'name': '永辉超市快餐专柜',\n",
       "   'id': 'B0I6ARBCZD',\n",
       "   'location': '113.327019,23.132145',\n",
       "   'type': '餐饮服务;快餐厅;快餐厅',\n",
       "   'typecode': '050300',\n",
       "   'pname': '广东省',\n",
       "   'cityname': '广州市',\n",
       "   'adname': '天河区',\n",
       "   'address': '正佳广场负百佳(体育中心地铁站出入口旁)',\n",
       "   'pcode': '440000',\n",
       "   'citycode': '020',\n",
       "   'adcode': '440106',\n",
       "   'business': {'rectag': '小吃快餐', 'keytag': '小吃快餐'},\n",
       "   'indoor': {'indoor_map': '0'}},\n",
       "  {'name': '大吉大利餐厅',\n",
       "   'id': 'B0I65H9Z9A',\n",
       "   'location': '113.327019,23.132145',\n",
       "   'type': '餐饮服务;中餐厅;中餐厅',\n",
       "   'typecode': '050100',\n",
       "   'pname': '广东省',\n",
       "   'cityname': '广州市',\n",
       "   'adname': '天河区',\n",
       "   'address': '正佳广场5楼A025',\n",
       "   'pcode': '440000',\n",
       "   'citycode': '020',\n",
       "   'adcode': '440106',\n",
       "   'business': {'rectag': '中餐',\n",
       "    'keytag': '中餐',\n",
       "    'rating': '3.1',\n",
       "    'opentime_today': '11:00-22:00',\n",
       "    'opentime_week': '11:00-22:00'},\n",
       "   'indoor': {'indoor_map': '0'}},\n",
       "  {'name': 'ONLY SWEET唯馨·西餐',\n",
       "   'id': 'B0H1SUI2F0',\n",
       "   'location': '113.326984,23.132191',\n",
       "   'type': '餐饮服务;外国餐厅;西餐厅(综合风味)',\n",
       "   'typecode': '050201',\n",
       "   'pname': '广东省',\n",
       "   'cityname': '广州市',\n",
       "   'adname': '天河区',\n",
       "   'address': '天河路228号正佳广场M层(体育中心地铁站出入口旁)',\n",
       "   'pcode': '440000',\n",
       "   'citycode': '020',\n",
       "   'adcode': '440106',\n",
       "   'business': {'tel': '18126781279',\n",
       "    'rectag': '西餐',\n",
       "    'keytag': '西餐',\n",
       "    'rating': '4.4',\n",
       "    'opentime_today': '11:00-21:30',\n",
       "    'opentime_week': '11:00-21:30'},\n",
       "   'indoor': {'indoor_map': '0'},\n",
       "   'photos': [{'title': '',\n",
       "     'url': 'http://store.is.autonavi.com/showpic/2c7d47915022d6a40c4154f3ddeb59c3'},\n",
       "    {'title': '',\n",
       "     'url': 'http://store.is.autonavi.com/showpic/631135569f8b26460f9c375e3834c5b1'},\n",
       "    {'title': '',\n",
       "     'url': 'http://store.is.autonavi.com/showpic/751fc1a615cbcc262425a0d2487dea89'}]},\n",
       "  {'name': '川香牛肉面(正佳广场店)',\n",
       "   'id': 'B0GKVA33BS',\n",
       "   'location': '113.327069,23.132205',\n",
       "   'type': '餐饮服务;快餐厅;快餐厅',\n",
       "   'typecode': '050300',\n",
       "   'pname': '广东省',\n",
       "   'cityname': '广州市',\n",
       "   'adname': '天河区',\n",
       "   'address': '南街道正佳广场M层A01铺(体育中心地铁站出入口旁)',\n",
       "   'pcode': '440000',\n",
       "   'citycode': '020',\n",
       "   'adcode': '440106',\n",
       "   'business': {'rectag': '牛肉面', 'keytag': '牛肉面'},\n",
       "   'indoor': {'indoor_map': '0'}},\n",
       "  {'name': '湘辣辣·现炒黄牛肉(正佳广场店)',\n",
       "   'id': 'B0IGXHLRLX',\n",
       "   'location': '113.327045,23.132123',\n",
       "   'type': '餐饮服务;中餐厅;中餐厅',\n",
       "   'typecode': '050100',\n",
       "   'pname': '广东省',\n",
       "   'cityname': '广州市',\n",
       "   'adname': '天河区',\n",
       "   'address': '天河路228号正佳广场5楼(体育中心地铁站出入口旁)',\n",
       "   'pcode': '440000',\n",
       "   'citycode': '020',\n",
       "   'adcode': '440106',\n",
       "   'business': {'rectag': '中餐', 'keytag': '中餐', 'rating': '2.6'},\n",
       "   'indoor': {'indoor_map': '0'}}],\n",
       " 'count': '10'}"
      ]
     },
     "execution_count": 160,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "r.json()"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "0f482331",
   "metadata": {},
   "source": [
    "### 利用pandas做成表格"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 153,
   "id": "1f635231",
   "metadata": {},
   "outputs": [],
   "source": [
    "import pandas as pd"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 162,
   "id": "56718fb0",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>name</th>\n",
       "      <th>id</th>\n",
       "      <th>location</th>\n",
       "      <th>type</th>\n",
       "      <th>typecode</th>\n",
       "      <th>pname</th>\n",
       "      <th>cityname</th>\n",
       "      <th>adname</th>\n",
       "      <th>address</th>\n",
       "      <th>pcode</th>\n",
       "      <th>...</th>\n",
       "      <th>adcode</th>\n",
       "      <th>business.rectag</th>\n",
       "      <th>business.keytag</th>\n",
       "      <th>business.rating</th>\n",
       "      <th>business.cost</th>\n",
       "      <th>indoor.indoor_map</th>\n",
       "      <th>photos</th>\n",
       "      <th>business.tel</th>\n",
       "      <th>business.opentime_today</th>\n",
       "      <th>business.opentime_week</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>0</th>\n",
       "      <td>膳老头猪肚鸡(正佳广场店)</td>\n",
       "      <td>B0G1X9GFSA</td>\n",
       "      <td>113.327030,23.132175</td>\n",
       "      <td>餐饮服务;中餐厅;中餐厅</td>\n",
       "      <td>050100</td>\n",
       "      <td>广东省</td>\n",
       "      <td>广州市</td>\n",
       "      <td>天河区</td>\n",
       "      <td>天河路228号正佳广场F5(体育中心地铁站出入口旁)</td>\n",
       "      <td>440000</td>\n",
       "      <td>...</td>\n",
       "      <td>440106</td>\n",
       "      <td>客家菜</td>\n",
       "      <td>客家菜</td>\n",
       "      <td>3.6</td>\n",
       "      <td>95.00</td>\n",
       "      <td>0</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1</th>\n",
       "      <td>小炒一碟(正佳广场店)</td>\n",
       "      <td>B0FFL77QA5</td>\n",
       "      <td>113.327030,23.132176</td>\n",
       "      <td>餐饮服务;中餐厅;中餐厅</td>\n",
       "      <td>050100</td>\n",
       "      <td>广东省</td>\n",
       "      <td>广州市</td>\n",
       "      <td>天河区</td>\n",
       "      <td>天河路228号正佳广场M层D53号</td>\n",
       "      <td>440000</td>\n",
       "      <td>...</td>\n",
       "      <td>440106</td>\n",
       "      <td>中餐</td>\n",
       "      <td>中餐</td>\n",
       "      <td>3.9</td>\n",
       "      <td>19.00</td>\n",
       "      <td>0</td>\n",
       "      <td>[{'title': '', 'url': 'https://img.alicdn.com/...</td>\n",
       "      <td>18902207247</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2</th>\n",
       "      <td>GABU尕布·新疆米粉</td>\n",
       "      <td>B0HD2YAUVU</td>\n",
       "      <td>113.327031,23.132177</td>\n",
       "      <td>餐饮服务;中餐厅;清真菜馆</td>\n",
       "      <td>050121</td>\n",
       "      <td>广东省</td>\n",
       "      <td>广州市</td>\n",
       "      <td>天河区</td>\n",
       "      <td>正佳广场M层</td>\n",
       "      <td>440000</td>\n",
       "      <td>...</td>\n",
       "      <td>440106</td>\n",
       "      <td>米粉</td>\n",
       "      <td>米粉</td>\n",
       "      <td>4.2</td>\n",
       "      <td>NaN</td>\n",
       "      <td>0</td>\n",
       "      <td>[{'title': '', 'url': 'http://store.is.autonav...</td>\n",
       "      <td>13076792612</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>3</th>\n",
       "      <td>鱼二郎(正佳广场店)</td>\n",
       "      <td>B0FFK04CFG</td>\n",
       "      <td>113.327021,23.132172</td>\n",
       "      <td>餐饮服务;中餐厅;中餐厅</td>\n",
       "      <td>050100</td>\n",
       "      <td>广东省</td>\n",
       "      <td>广州市</td>\n",
       "      <td>天河区</td>\n",
       "      <td>天河路228号正佳广场B1层001-002号</td>\n",
       "      <td>440000</td>\n",
       "      <td>...</td>\n",
       "      <td>440106</td>\n",
       "      <td>中餐</td>\n",
       "      <td>中餐</td>\n",
       "      <td>NaN</td>\n",
       "      <td>50.00</td>\n",
       "      <td>0</td>\n",
       "      <td>[{'title': '', 'url': 'http://store.is.autonav...</td>\n",
       "      <td>020-89817736</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>4</th>\n",
       "      <td>霸蛮湖南米粉</td>\n",
       "      <td>B0IAM5LO8Q</td>\n",
       "      <td>113.327019,23.132145</td>\n",
       "      <td>餐饮服务;中餐厅;中餐厅</td>\n",
       "      <td>050100</td>\n",
       "      <td>广东省</td>\n",
       "      <td>广州市</td>\n",
       "      <td>天河区</td>\n",
       "      <td>正佳广场负一楼BF-20-21</td>\n",
       "      <td>440000</td>\n",
       "      <td>...</td>\n",
       "      <td>440106</td>\n",
       "      <td>米粉</td>\n",
       "      <td>米粉</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>0</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>5</th>\n",
       "      <td>永辉超市快餐专柜</td>\n",
       "      <td>B0I6ARBCZD</td>\n",
       "      <td>113.327019,23.132145</td>\n",
       "      <td>餐饮服务;快餐厅;快餐厅</td>\n",
       "      <td>050300</td>\n",
       "      <td>广东省</td>\n",
       "      <td>广州市</td>\n",
       "      <td>天河区</td>\n",
       "      <td>正佳广场负百佳(体育中心地铁站出入口旁)</td>\n",
       "      <td>440000</td>\n",
       "      <td>...</td>\n",
       "      <td>440106</td>\n",
       "      <td>小吃快餐</td>\n",
       "      <td>小吃快餐</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>0</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>6</th>\n",
       "      <td>大吉大利餐厅</td>\n",
       "      <td>B0I65H9Z9A</td>\n",
       "      <td>113.327019,23.132145</td>\n",
       "      <td>餐饮服务;中餐厅;中餐厅</td>\n",
       "      <td>050100</td>\n",
       "      <td>广东省</td>\n",
       "      <td>广州市</td>\n",
       "      <td>天河区</td>\n",
       "      <td>正佳广场5楼A025</td>\n",
       "      <td>440000</td>\n",
       "      <td>...</td>\n",
       "      <td>440106</td>\n",
       "      <td>中餐</td>\n",
       "      <td>中餐</td>\n",
       "      <td>3.1</td>\n",
       "      <td>NaN</td>\n",
       "      <td>0</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>11:00-22:00</td>\n",
       "      <td>11:00-22:00</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>7</th>\n",
       "      <td>ONLY SWEET唯馨·西餐</td>\n",
       "      <td>B0H1SUI2F0</td>\n",
       "      <td>113.326984,23.132191</td>\n",
       "      <td>餐饮服务;外国餐厅;西餐厅(综合风味)</td>\n",
       "      <td>050201</td>\n",
       "      <td>广东省</td>\n",
       "      <td>广州市</td>\n",
       "      <td>天河区</td>\n",
       "      <td>天河路228号正佳广场M层(体育中心地铁站出入口旁)</td>\n",
       "      <td>440000</td>\n",
       "      <td>...</td>\n",
       "      <td>440106</td>\n",
       "      <td>西餐</td>\n",
       "      <td>西餐</td>\n",
       "      <td>4.4</td>\n",
       "      <td>NaN</td>\n",
       "      <td>0</td>\n",
       "      <td>[{'title': '', 'url': 'http://store.is.autonav...</td>\n",
       "      <td>18126781279</td>\n",
       "      <td>11:00-21:30</td>\n",
       "      <td>11:00-21:30</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>8</th>\n",
       "      <td>川香牛肉面(正佳广场店)</td>\n",
       "      <td>B0GKVA33BS</td>\n",
       "      <td>113.327069,23.132205</td>\n",
       "      <td>餐饮服务;快餐厅;快餐厅</td>\n",
       "      <td>050300</td>\n",
       "      <td>广东省</td>\n",
       "      <td>广州市</td>\n",
       "      <td>天河区</td>\n",
       "      <td>南街道正佳广场M层A01铺(体育中心地铁站出入口旁)</td>\n",
       "      <td>440000</td>\n",
       "      <td>...</td>\n",
       "      <td>440106</td>\n",
       "      <td>牛肉面</td>\n",
       "      <td>牛肉面</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>0</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>9</th>\n",
       "      <td>湘辣辣·现炒黄牛肉(正佳广场店)</td>\n",
       "      <td>B0IGXHLRLX</td>\n",
       "      <td>113.327045,23.132123</td>\n",
       "      <td>餐饮服务;中餐厅;中餐厅</td>\n",
       "      <td>050100</td>\n",
       "      <td>广东省</td>\n",
       "      <td>广州市</td>\n",
       "      <td>天河区</td>\n",
       "      <td>天河路228号正佳广场5楼(体育中心地铁站出入口旁)</td>\n",
       "      <td>440000</td>\n",
       "      <td>...</td>\n",
       "      <td>440106</td>\n",
       "      <td>中餐</td>\n",
       "      <td>中餐</td>\n",
       "      <td>2.6</td>\n",
       "      <td>NaN</td>\n",
       "      <td>0</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "<p>10 rows × 21 columns</p>\n",
       "</div>"
      ],
      "text/plain": [
       "               name          id              location                 type  \\\n",
       "0     膳老头猪肚鸡(正佳广场店)  B0G1X9GFSA  113.327030,23.132175         餐饮服务;中餐厅;中餐厅   \n",
       "1       小炒一碟(正佳广场店)  B0FFL77QA5  113.327030,23.132176         餐饮服务;中餐厅;中餐厅   \n",
       "2       GABU尕布·新疆米粉  B0HD2YAUVU  113.327031,23.132177        餐饮服务;中餐厅;清真菜馆   \n",
       "3        鱼二郎(正佳广场店)  B0FFK04CFG  113.327021,23.132172         餐饮服务;中餐厅;中餐厅   \n",
       "4            霸蛮湖南米粉  B0IAM5LO8Q  113.327019,23.132145         餐饮服务;中餐厅;中餐厅   \n",
       "5          永辉超市快餐专柜  B0I6ARBCZD  113.327019,23.132145         餐饮服务;快餐厅;快餐厅   \n",
       "6            大吉大利餐厅  B0I65H9Z9A  113.327019,23.132145         餐饮服务;中餐厅;中餐厅   \n",
       "7   ONLY SWEET唯馨·西餐  B0H1SUI2F0  113.326984,23.132191  餐饮服务;外国餐厅;西餐厅(综合风味)   \n",
       "8      川香牛肉面(正佳广场店)  B0GKVA33BS  113.327069,23.132205         餐饮服务;快餐厅;快餐厅   \n",
       "9  湘辣辣·现炒黄牛肉(正佳广场店)  B0IGXHLRLX  113.327045,23.132123         餐饮服务;中餐厅;中餐厅   \n",
       "\n",
       "  typecode pname cityname adname                     address   pcode  ...  \\\n",
       "0   050100   广东省      广州市    天河区  天河路228号正佳广场F5(体育中心地铁站出入口旁)  440000  ...   \n",
       "1   050100   广东省      广州市    天河区           天河路228号正佳广场M层D53号  440000  ...   \n",
       "2   050121   广东省      广州市    天河区                      正佳广场M层  440000  ...   \n",
       "3   050100   广东省      广州市    天河区      天河路228号正佳广场B1层001-002号  440000  ...   \n",
       "4   050100   广东省      广州市    天河区             正佳广场负一楼BF-20-21  440000  ...   \n",
       "5   050300   广东省      广州市    天河区        正佳广场负百佳(体育中心地铁站出入口旁)  440000  ...   \n",
       "6   050100   广东省      广州市    天河区                  正佳广场5楼A025  440000  ...   \n",
       "7   050201   广东省      广州市    天河区  天河路228号正佳广场M层(体育中心地铁站出入口旁)  440000  ...   \n",
       "8   050300   广东省      广州市    天河区  南街道正佳广场M层A01铺(体育中心地铁站出入口旁)  440000  ...   \n",
       "9   050100   广东省      广州市    天河区  天河路228号正佳广场5楼(体育中心地铁站出入口旁)  440000  ...   \n",
       "\n",
       "   adcode business.rectag business.keytag business.rating business.cost  \\\n",
       "0  440106             客家菜             客家菜             3.6         95.00   \n",
       "1  440106              中餐              中餐             3.9         19.00   \n",
       "2  440106              米粉              米粉             4.2           NaN   \n",
       "3  440106              中餐              中餐             NaN         50.00   \n",
       "4  440106              米粉              米粉             NaN           NaN   \n",
       "5  440106            小吃快餐            小吃快餐             NaN           NaN   \n",
       "6  440106              中餐              中餐             3.1           NaN   \n",
       "7  440106              西餐              西餐             4.4           NaN   \n",
       "8  440106             牛肉面             牛肉面             NaN           NaN   \n",
       "9  440106              中餐              中餐             2.6           NaN   \n",
       "\n",
       "  indoor.indoor_map                                             photos  \\\n",
       "0                 0                                                NaN   \n",
       "1                 0  [{'title': '', 'url': 'https://img.alicdn.com/...   \n",
       "2                 0  [{'title': '', 'url': 'http://store.is.autonav...   \n",
       "3                 0  [{'title': '', 'url': 'http://store.is.autonav...   \n",
       "4                 0                                                NaN   \n",
       "5                 0                                                NaN   \n",
       "6                 0                                                NaN   \n",
       "7                 0  [{'title': '', 'url': 'http://store.is.autonav...   \n",
       "8                 0                                                NaN   \n",
       "9                 0                                                NaN   \n",
       "\n",
       "   business.tel business.opentime_today business.opentime_week  \n",
       "0           NaN                     NaN                    NaN  \n",
       "1   18902207247                     NaN                    NaN  \n",
       "2   13076792612                     NaN                    NaN  \n",
       "3  020-89817736                     NaN                    NaN  \n",
       "4           NaN                     NaN                    NaN  \n",
       "5           NaN                     NaN                    NaN  \n",
       "6           NaN             11:00-22:00            11:00-22:00  \n",
       "7   18126781279             11:00-21:30            11:00-21:30  \n",
       "8           NaN                     NaN                    NaN  \n",
       "9           NaN                     NaN                    NaN  \n",
       "\n",
       "[10 rows x 21 columns]"
      ]
     },
     "execution_count": 162,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "pd.json_normalize(r.json()['pois'])"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "id": "96281aa4",
   "metadata": {},
   "outputs": [],
   "source": []
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "Python 3",
   "language": "python",
   "name": "python3"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.8.8"
  },
  "toc": {
   "base_numbering": 1,
   "nav_menu": {},
   "number_sections": true,
   "sideBar": true,
   "skip_h1_title": false,
   "title_cell": "Table of Contents",
   "title_sidebar": "Contents",
   "toc_cell": false,
   "toc_position": {},
   "toc_section_display": true,
   "toc_window_display": false
  }
 },
 "nbformat": 4,
 "nbformat_minor": 5
}
